package com.ibeeking.found.id.api.feign;

import com.ibeeking.found.id.api.common.dto.SerialNumberDTO;
import com.ibeeking.found.id.api.feign.fallback.IdFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-id-server", fallbackFactory = IdFeignFallbackFactory.class, decode404 = true)
public interface IdFeignClient {

    @PostMapping(value = "/id/feign/v1/selectIds/{count}")
    ResponseResult<List<Object>> selectIds(@PathVariable("count") Integer count);

    @PostMapping(value = "/id/serialNoRule/feign/v1/generateSerialNo/{keyCode}")
    ResponseResult<SerialNumberDTO> generateSerialNo(@PathVariable("keyCode") @NotBlank(message = "keyCode必填") String keyCode);

}
